package com.after.saas.file.function;

import com.after.saas.client.service.RemoteUserService;
import com.after.saas.common.model.bo.UserBO;
import com.after.saas.file.utils.SpringUtil;
import lombok.extern.slf4j.Slf4j;

import java.util.List;


/**
 * @Classname CommentConsumer
 * @Description TODO
 * @Date 2021/3/25 9:04
 * @Created by hjchen
 */

@Slf4j
public class UserConsumer implements ExcelConsumer<UserBO> {

    private final RemoteUserService remoteUserService = SpringUtil.getBean(RemoteUserService.class);

    @Override
    public void executeRead(List<UserBO> e) {
        log.warn("remoteUserService {} size {}", remoteUserService, e.size());
        remoteUserService.batchSave(e);
    }

    @Override
    public void check(List<UserBO> e) {
        log.warn("User.size {}", e.size());
    }
}